<%@ taglib prefix="c" uri="jakarta.tags.core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <base href="<%=request.getContextPath()%>/">
    <meta charset="UTF-8">
    <title>编辑用户</title>
    <link rel="stylesheet" href="statics/css/newsStyle.css">
</head>
<body>
<%@include file="../common/sidebar.jsp"%>
<div class="main-content">
    <%@include file="../common/top.jsp"%>
    <div class="content">
        <div class="card">
            <h2 class="section-title">编辑用户</h2>
            <form action="user/modify" method="post">
                <!-- 隐藏域传递用户ID -->
                <input type="hidden" name="userId" value="${user.userId}"/>
                <div class="form-group">
                    <label>用户名：</label>
                    <input type="text" name="userName" value="${user.userName}" class="form-control" required>
                </div>
                <div class="form-group">
                    <label>密码：</label>
                    <input type="password" name="password" placeholder="不修改请留空" class="form-control">
                </div>
                <div class="form-group">
                    <label>邮箱：</label>
                    <input type="email" name="email" value="${user.email}" class="form-control" required>
                </div>
                <div class="form-group">
                    <label>手机号：</label>
                    <input type="text" name="phone" value="${user.phone}" class="form-control">
                </div>
                <div class="form-group">
                    <label>用户类型：</label>
                    <select name="userType" class="form-control">
                        <option value="0" <c:if test="${user.userType eq 0}">selected</c:if>>普通用户</option>
                        <option value="1" <c:if test="${user.userType eq 1}">selected</c:if>>管理员</option>
                    </select>
                </div>
                <div class="form-actions">
                    <button type="submit" class="btn btn-primary">保存修改</button>
                    <a href="user/find" class="btn btn-default">取消</a>
                </div>
            </form>
        </div>
    </div>
</div>
</body>
</html>